import './assets/main.css'

import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import ElementPlus from 'element-plus'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import 'element-plus/dist/index.css'
import axios from 'axios'
import DataVVue3 from '@kjgl77/datav-vue3'
import { Swiper, SwiperItem } from 'tdesign-vue-next'
import 'tdesign-vue-next/es/style/index.css'

const app = createApp(App)

// 注册 TDesign 组件
app.component('t-swiper', Swiper)
app.component('t-swiper-item', SwiperItem)

// 注册所有图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

// 配置axios
axios.defaults.baseURL = 'http://localhost:8080'
axios.defaults.withCredentials = true

app.use(ElementPlus)
app.use(router)
app.use(DataVVue3)
app.mount('#app')
